This invention relates to systems and methods for interfacing a service component to a native operating system application program interface (API).
A computer system typically includes an operating system that provides an environment in which one or more application programs may run. The operating system generally controls the operation of the computer system and the allocation of system resources. The operating system also exposes system services to the application programs, which, in turn, use these services to perform one or more computing tasks. In the Windows NT Server operating system, for example, a Win32 subsystem makes a 32-bit application programming interface (API) available to application programs. Typical operating system services include memory services, process creation services, and processing scheduling services.
Operating systems, such as the Windows NT Server operating system, make extensive use of dynamic link libraries. A dynamic link library (DLL) is a computer code module that contains functions to be linked with application code. A DLL may be loaded and linked to an application at run time, and may be unloaded when its functionality is no longer needed. A DLL usually consists of a set of autonomous functions that any application may use. In 32-bit Windows operating systems, such as Windows NT, Windows 95 and Windows CE, all of the functions in the Win32 API are contained in DLLs. Further details about the Win32 API may be found in xe2x80x9cAdvanced windows,xe2x80x9d Third Edition, Jeffrey Richter, Microsoft Press (1997), which is incorporated herein by reference.
In the 32-bit Windows environment, for an application (or another DLL) to call the system service functions of the Win32 API, the application must conform to a standard C-based interface. Accordingly, most service components operating in a 32-bit Windows environment are written in the C or C++ programming languages. In order to invoke the functionality of service components written in other programming languages, each component must provide its own customized operating environment in which the component may operate. For example, programs written in the JAVA programming language must operate in an environment provided by a JAVA virtual machine (JVM). The JVM is an abstract native computing machine that runs within an operating system to interpret and execute JAVA applications. Further details about the JVM may be obtained from xe2x80x9cThe Java(trademark) Virtual machine Specification,xe2x80x9d Tim Lindholm and Frank Yellin, Addison Wesley (1997), which is incorporated herein by reference.
The invention features systems and methods for interfacing a service component written in any one of a variety of programming languages to a native operating system application program interface (API). In one aspect, the invention features an interface module configured to load a service component written in a non-native programming language. In another aspect, the invention features an interface module configured to retrieve service component information from a configuration database.
Embodiments may include one or more of the following features.
The interface module preferably is configured to create an application operating environment in which the service component application is operable. For example, in one embodiment the interface module is configured to create a JAVA virtual machine for executing a service component application written in a JAVA programming language. The interface module preferably is configured to treat the application operating environment and the service component application as a single process during execution. In particular, the interface module preferably is configured to create an application thread on which to create the application operating environment. The interface module may be configured to create a main thread for monitoring and blocking the application thread.
The interface module preferably is configured to retrieve service component information from a configuration database. The interface module may be configured to retrieve from the configuration database the identity of a service component application to be executed. The interface module preferably is configured to load, run and control the identified service component application, and to obtain information about the run-time status of the component application.
The interface module preferably includes a service component interface dynamic link library (DLL). In one embodiment, the interface module is operable under the Windows NT Server operating system, and is configured to interface a Win32 API to service components written in C, C++ and JAVA programming languages.
Among the advantages of the invention are the following.
The invention provides a generic interface between a native operating system API and service components written in different programming languages (e.g., C, C++, and JAVA). By separating service functionality from other aspects of the system, the invention enables developers to create services more easily and with greater flexibility. Furthermore, services developed in accordance with the invention may be more easily maintained and tested because service maintenance and testing may be performed separately from other components of the system. For example, a dependability system implemented with services designed in accordance with the invention may be replaced or updated without modifying the underlying service modules. Furthermore, new services may be readily added to the system without changing the dependability system. For example, with the invention a system designer merely has to replace the appropriate DLL or JAVA class with a new service module that implements the desired functionality. The inventive use of the system configuration database (registry) enables system designers to readily implement service functionality with existing service modules regardless of the programming language used to create the service modules. The invention also enables developers to generate service modules without having to worry about the details of the native API interface.